<template>
  <div class="helpWrap">
		<!--start 按钮--> 
		<div class="icoBtn" @click="show">
			<i class="iconfont">&#xe667;</i>
			<span>帮助</span>
		</div>
		<!--end 按钮-->  	
		<!--start cover-->
		<div class="helpCover" v-show="$store.state.helpShow" @click="hide"></div>
		<!--end cover-->
		<!--start content-->
		<transition name="fade">
			<div class="helpContent" v-show="$store.state.helpShow">
				<div>
					<h2>
						<i class="iconfont">&#xe622;</i>
						<slot name="headText"></slot>
					</h2>
					<div class="headerDesc">
						<slot name="headDescText"></slot>
					</div>
				</div>
				<div class="helpContentWrap">
					<slot name="helpContentWrap"></slot>
				</div>
			</div>
		</transition>
		<!--end content-->
  </div>
</template>

<script>
	export default {
		methods:{
			show(){
				this.$store.commit('newHelpShow',true);
			},
			hide(){
				this.$store.commit('newHelpShow',false);
			}
		}
	}
	
</script>

<style>
  .helpWrap {
  	position: absolute;
  	height: 40px;
  	line-height: 40px;
  	top: 44px;
  	right: 20px;
  }
  .helpWrap .icoBtn{
  	height: 40px;
  	line-height: 40px;
  	cursor: pointer;
  }
  .helpWrap .icoBtn:hover{
  	color: #13c19f;
  }
  .helpWrap .helpCover{
  	position: fixed;
  	top: 0;
  	bottom: 0;
  	left: 0;
  	right: 0;
  	margin: auto;
  	background: rgba(255,255,255,.2);
  	z-index: 9000;
  }
  .helpWrap .helpContent{
  	position: fixed;
  	width: 360px;
  	top: 44px;
  	right: 0;
  	bottom: 0;
  	z-index: 9990;
  	background-color: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,.2);
    overflow-y:auto;
  }
  .helpWrap .helpContent h2 {
  	padding: 22px 0 0 20px;
    font-size: 16px;
    font-weight: 400;
  }
  .helpWrap .helpContent h2 i{
  	vertical-align: middle;
  }
  .helpWrap .headerDesc{
  	margin-top: 30px;
  }
  .helpWrap .headerDesc p{
  	margin-top: 0;
  	padding: 0 20px;
    line-height: 20px;
    font-size: 12px;
    color: #96a6b6;
  }
  .helpWrap .helpContentWrap h3{
    padding-top: 30px;
    padding-bottom: 15px;
    padding-left: 20px;
    font-size: 13px;
    font-weight: 400;
    color: #415161;
  }
  .helpWrap .helpContentWrap h3+p{
    padding: 0 20px;
    line-height: 20px;
    font-size: 12px;
    color: #96a6b6;
  }
  .helpWrap .fade-enter-active,.helpWrap  .fade-leave-active {
  	right: 0;
	  transition: .5s
	}
	.helpWrap .fade-enter,.helpWrap  .fade-leave-active {
	  right: -360px;
	}
</style>
